claude code vscode扩展使用glm视觉mcp
在 vscode cc 扩展中直接使用 /mcp 会看到无法连接这个 zai-mcp-server
但是其他 http 类型的他能够连接,所以我怀疑是 vscode cc扩展还不支持 stdio 的mcp
经过搜索发现 `mcp-proxy` 这个npm包支持将 stdio 类型的转 http。
所以安装: npm install -g mcp-proxy
然后在 windows 上可以使用 powerShell 运行如下命令
bash
$env:Z_AI_API_KEY = "你的密钥"
$env:Z_AI_MODE = "ZHIPU"
$env:NPM_CONFIG_REGISTRY = "https://registry.npmmirror.com"
mcp-proxy --port 3000 --shell pnpx @z_ai/mcp-server
log
[2025-11-07T01:53:14.082Z] INFO: MCP Server Application initialized
[2025-11-07T01:53:14.083Z] INFO: Starting MCP server...
[2025-11-07T01:53:14.084Z] INFO: Image analysis tool registered successfully
[2025-11-07T01:53:14.084Z] INFO: Video analysis tool registered successfully
[2025-11-07T01:53:14.084Z] INFO: Successfully registered all tools
[2025-11-07T01:53:14.085Z] INFO: MCP Server started successfully [{"mode":"ZHIPU","name":"zai-mcp-server","version":"0.1.0"}]
starting server on port 3000
成功
修改原来的 stdio 类型的mcp为刚才的 http 类型的mcp,再返回去vscode 中运行 /mcp 命令查看连接状态,成功!